import { getStorage, setStorage } from "@/utils"
import { defineStore } from "pinia"
import { SystemInfoTypes } from "@/types"



interface Props {
  systemInfo: SystemInfoTypes
}

const appStore = defineStore("app",{
  state():Props {
    return {
      systemInfo: getStorage("systemInfo") || {}
    }
  },
  getters:{

  },
  actions:{
    async setSystemInfo (options: SystemInfoTypes) {
      this.systemInfo = options
      console.log(this.systemInfo)
      await setStorage('systemInfo',options)
    }
  }
})

export default appStore
